#ifndef __GAF_DEBUG_H__
#define __GAF_DEBUG_H__

#include "GAF_OutPut.h"

#ifdef GAF_HASTRY
#define GAF_TRY				try
#define GAF_CATCH(_EType, _pE)		catch(_EType, _pException)
#define GAF_CATCHALL()			catch(...)
#else
#define GAF_TRY				if(1 == 0)
#define GAF_CATCH(_EType, _pE)		if(1 == 0)
#define GAF_CATCHALL()			if(1 == 0)
#endif

#ifdef GAF_DEBUG
/// 断言
#define GAF_ASSERT(f) \
	if((int)(f) == 0) \
	{ \
		GAF_ERROR("Assert <%s> is FALSE!", ""#f); \
		SYS_ASSERT(0); \
	}
#else /*GAF_DEBUG*/
#define GAF_ASSERT(f)
#endif /*GAF_DEBUG*/

// 如果表达式不成立则返回
/// 检查
#define GAF_CHECK(f) \
	if((int)(f) == 0) \
	{ \
		GAF_LOG("Check <%s> is FALSE!", ""#f); \
		return; \
	}
/// 检查
#define GAF_CHECK_R(f, r) \
	if((int)(f) == 0) \
	{ \
		GAF_LOG("Check <%s> is FALSE!", ""#f); \
		return r; \
	}


#endif
